package com.arpa.wms.domain.dto;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Max;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

/**
 * <p>
 * 承运商审核DTO
 * </p>
 *
 * @author LEO
 * @since 2021-2-22
 */
@Data
@ApiModel(value="CarrierauditDTO对象")
public class CarrierauditDTO {


    @ApiModelProperty(value = "全局code")
    @NotNull
    private String code;

    @ApiModelProperty(value = "审批人编码")
    @TableField("approved_by")
    private String approvedBy;

    @ApiModelProperty(value = "审批人姓名")
    @TableField("approved_name")
    @Length(max = 50, message = "姓名长度不能大于50个字符")
    private String approvedName;

    @ApiModelProperty(hidden = true)
    @TableField(value = "gmt_approved", fill = FieldFill.INSERT_UPDATE)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime gmtApproved;

    @ApiModelProperty(value = "状态 ，0-未审核，1-审核通过，2-审核未通过")
    @TableField("status")
    @Max(value = 2,message = "审核有误")
    private String status;

}
